<template>
  <div>
    <div class="maintop">
      <span class="release">存款收益</span>
    </div>
    <div class="putforwardbox">
      <ul class="tabsItems_item"
        v-for="(list , index) of revenueData"
        :key="index">
        <li>
          <h2>时间</h2>
          <p>{{list.produceTime | handleTime}}</p>
        </li>
        <li>
          <h2>存款数量</h2>
          <p>{{list.investNum}}</p>
        </li>
        <li>
          <h2>利率</h2>
          <p>{{list.ratio}}</p>
        </li>
        <li>
          <h2>收益</h2>
          <p>{{list.produceNum}}</p>
        </li>
      </ul>
    </div>
    <div v-if="!revenueData[0]"
      class="warn c5 fs16">暂无数据...</div>
  </div>
</template>

<script>
import { Indicator } from "mint-ui";
export default {
  created() {
    this.getRevenueData();
  },
  data() {
    return {
      revenueData: []
    };
  },
  methods: {
    async getRevenueData() {
      this.userid = JSON.parse(localStorage.getItem("localdata")).uuid;

      Indicator.open();
      let RevenueRes = await this.$http.post(
        "/bus/invest/grows",
        this.$qs.stringify({
          pageNum: 0,
          userId: this.userid,
          pageSize: 30
        })
      );
      Indicator.close();
      if (RevenueRes.data.code == 200) {
        this.revenueData = RevenueRes.data.data.rsList;
        console.log(this.revenueData);
      }
    }
  }
};
</script>


<style lang="scss" src="./styles/index.scss" scoped>
</style>